package ops

import (
	"com.mgface.disobj/apinode/api"
	"com.mgface.disobj/apinode/objstream"
)

//objName 对象名称
//index 数据分片
func putStream(hashValue, objName string, index int, expectIps []string) (*objstream.PutStream, []string, error) {
	nodeAddr, expectIps, err := api.ChooseRandomDataNode(index, expectIps)
	if err != nil {
		return nil, nil, err
	}
	putstream := objstream.NewPutStream(hashValue, nodeAddr, objName, index)
	return putstream, expectIps, nil
}
